package com.sfj.config.handler;

import com.kaka.starter.control.dto.ResultBean;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author kaka
 * @Date 2025/5/1
 */
@ControllerAdvice
public class WholeExceptionHandler {

    @ExceptionHandler
    @ResponseBody
    public ResultBean exceptionHandler(Exception e) {
        return ExceptionHandlerRule.getErrorResult(e);
    }
}
